using namespace std;

#include <vector>
#include <string>

#ifndef MODEL_H
#define MODEL_H

struct Point
{
	Point() {}

	Point(float _x, float _y, float _z)
	{
		x = _x;
		y = _y;
		z = _z;
	}

	void SetPoints(float _x, float _y, float _z)
	{
		x = _x;
		y = _y;
		z = _z;
	}

	Point Point::operator+ (Point param)
	{
		Point temp(0, 0, 0);
		temp.x = x + param.x;
		temp.y = y + param.y;
		temp.z = z + param.z;

		return (temp);
	}

	Point Point::operator- (Point param)
	{
		Point temp(0, 0, 0);
		temp.x = x - param.x;
		temp.y = y - param.y;
		temp.z = z - param.z;

		return (temp);
	}

	Point Point::operator* (Point param) 
	{
		Point temp(0, 0, 0);
		temp.x = x * param.x;
		temp.y = y * param.y;
		temp.z = z * param.z;
		return (temp);
	}

	Point Point::operator* (float num)
	{
		Point temp(0, 0, 0);
		temp.x = x * num;
		temp.y = y * num;
		temp.z = z * num;

		return (temp);
	}

	
	float x, y, z;
};

struct Triangle
{
	Triangle() {}
	Triangle(Point _a, Point _b, Point _c)
	{
		a = _a;
		b = _b;
		c = _c;
	}

	void SetNormal(Point _normal)
	{
		normal = _normal;
	}

	Point a, b, c;
	Point normal;
};

class Model
{
public:
	Model(void);
	
	void LoadFile(string path);
	void DrawWireFrame();
	void DrawModel();

private:
	void ParsePoint(string line, string type);
	void ParseTriangle(string line);

	vector<Point> vertices;
	vector<Point> normals;
	vector<Triangle> triangles;
	Point pos;
};

#endif

